<div data-page="note-detail" class="page navbar-through no-toolbar note-detail">

	<div class="navbar">
		<div class="navbar-inner">
			<div class="left">
				<a href="#" class="link back icon-only"><i class="ti-arrow-circle-left"></i></a>
			</div>
			<div class="center">请假条信息</div>
			<div class="right"></div>
		</div>
	</div>
	
	<div class="page-content">
	
		<div class="content-block-title">申请人</div>
		<div class="list-block">
			<ul>
				<li>
					<div class="item-content">
						<div class="item-media">
							<img src="<%=note.form.owner.avatar%>64" width="32">
						</div>
						<div class="item-inner">
							<div class="item-title"><%=note.form.owner.name%></div>
						</div>
					</div>
				</li>
			</ul>
		</div>

		<div class="content-block-title">基本信息</div>
		<div class="list-block">
			<ul>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title">开始时间</div>
							<div class="item-after"><%= sails.formatTime(note.startTime)%></div>
						</div>
					</div>
				</li>

				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title">结束时间</div>
							<div class="item-after"><%= sails.formatTime(note.endTime)%></div>
						</div>
					</div>
				</li>
				
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title">小时数</div>
							<div class="item-after"><%=note.hours%></div>
						</div>
					</div>
				</li>
				
			</ul>
		</div>

		<div class="content-block-title">休假类型</div>
		<div class="list-block">
			<ul>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title">休假类型</div>
							<div class="item-after"><%=note.type.name%></div>
						</div>
					</div>
				</li>
			</ul>
		</div>
		
		<div class="content-block-title">休假原因</div>
		<div class="list-block">
			<ul>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-after"><%=note.reason%></div>
						</div>
					</div>
				</li>
			</ul>
		</div>

		<% if (note.form.opinions.length != 0) { %>
		<div class="content-block-title">审批信息</div>
		<div class="list-block opinion-list">
		<ul>
			<% note.form.opinions.forEach(function(opinion){ %>
			<li>
				<div class="item-content">
					<div class="item-media">
						<img src="<%=opinion.superior.avatar%>64" width="32">
					</div>
					<div class="item-inner">
						<div class="item-title"><%=opinion.superior.name%></div>
						<div class="item-after">
						<% if (opinion.action == 1) { %>
							<span class="fail"><%=opinion.opinion%></span>
						<% } %>
						<% if (opinion.action == 2) { %>
							<span class="success"><%=opinion.opinion%></span>
						<% } %>
						<% if (opinion.action == 3) { %>
							<span class="finish"><%=opinion.opinion%></span>
						<% } %>
						</div>
					</div>
				</div>
			</li>
			<% }) %>
		</ul>
		</div>
		<% } %>
		

			
		<% if (note.form.waitChecker == req.session.user.userid) { %>
		<form class="external form-form-check">

		<input type="hidden" name="form[id]" value="<%=note.form.id%>">
		<input type="hidden" name="form[lastChecker]" value="<%=req.session.user.userid%>">
		<input type="hidden" name="form[waitChecker]" value="">
		<input type="hidden" name="opinion[superior]" value="<%=req.session.user.userid%>">
		<input type="hidden" name="opinion[form]" value="<%=note.form.id%>">

		<div class="content-block-title">审批意见</div>
		<div class="list-block">
			<ul>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-input">
								<input type="text" name="opinion[opinion]" required>
							</div>
						</div>
					</div>
				</li>
			</ul>
		</div>
		<div class="content-block">
			<div class="row">
				<div class="col-50"><a href="#" class="button button-big button-fill color-red btn-form-check" check-flag="1">驳回</a></div>
				<div class="col-50"><a href="#" class="button button-big button-fill color-green btn-form-check" check-flag="2">同意</a></div>
			</div>
			<br/>
			<div class="row">
				<div class="col-100"><a href="#" class="button button-big button-fill color-blue btn-form-check" check-flag="3">完成</a></div>
			</div>
		</div>
		</form>
		<% } %>
		
		<% if (note.form.lastChecker == req.session.user.userid && (note.form.state == 0 || note.form.state == 2)) { %>
		<div class="content-block">
		<p>
			<a href="<%=sails.config.application.appPrefix%>/contacts?option=true&type=note&pkid=<%=note.id%>" class="button button-fill button-big color-red">发送</a>
		</p>
		</div>
		<% } %>
			
	</div>
</div>
